package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.List;

public class MoviesList {
    List<Movies> moviesList;

    public MoviesList(){
        this.moviesList = new ArrayList<Movies>();
        Init();
    }

    private List Init(){
        Movies movies0 = new Movies("name0", "year0", "director0", "unrated");
        moviesList.add(movies0);
        Movies movies1 = new Movies("name1", "year1", "director1", "1");
        moviesList.add(movies1);
        Movies movies2 = new Movies("name2", "year2", "director2", "2");
        moviesList.add(movies2);
        Movies movies3 = new Movies("name3", "year3", "director3", "3");
        moviesList.add(movies3);
        Movies movies4 = new Movies("name4", "year4", "director4", "4");
        moviesList.add(movies4);
        Movies movies5 = new Movies("name5", "year5", "director5", "5");
        moviesList.add(movies5);
        Movies movies6 = new Movies("name6", "year6", "director6", "6");
        moviesList.add(movies2);

        return moviesList;
    }

    public void printMoviesList() {
        for (int i = 0; i < moviesList.size(); i++)
            if (moviesList.get(i).isAvailable()) {
                String message = moviesList.get(i).getName() + "  "
                        + moviesList.get(i).getYear() + "  "
                        + moviesList.get(i).getDirector() + "  "
                        + moviesList.get(i).getRating();
                System.out.println(message);
            }
    }
}
